<template>
    <div>
      全选 <input type="checkbox" v-model="chkall" @change="abc" />

      <input type="checkbox" v-model="a1" value="1" />
      <input type="checkbox" v-model="a1" value="2" />
      <input type="checkbox" v-model="a1" value="3" />
      <input type="checkbox" v-model="a1" value="4" />
      <input type="checkbox" v-model="a1" value="5" />


      <hr />
      <h3>获取子组件的数据： {{msg1}}</h3>
      <first-head msg="hello world"  @enlarge-text="getchild" />
      <hr />
      <sheng-shi-qu />
      <hr />
      <slot-alert>
        2222222222222222
      </slot-alert>
      
      <hr />nnn
      <h1>{{count}}</h1>nn

    </div>

</template>
<script>

import slotAlert from '@/components/slotalert'
import firstHead from '@/components/head'
import shengShiQu from '@/components/shengshi'

// mapState辅助取值，computed
import { mapState, mapActions } from 'vuex'

export default {
  name: 'aaa',
  data() {
    return {
      chkall: false,
      a1:[],
      msg1: ''
    }
  },
  computed: {
    // 数据模型中多了一个 count
    ...mapState({count: state => state.test.count})
  },
  created() {
   
  },
  methods: {
    getchild(data) {
      console.info(arguments)
      console.info(data.msg1)
      this.msg1 = data.msg1
    },
    abc(){
      if (this.chkall) {
        this.a1 = [1,2,3,4,5]
      } else {
        this.a1 = []
      }
    }
  },
  components: {
    firstHead,
    shengShiQu,
    slotAlert
  }
}
</script>
<style>

</style>
